package com.example.coursemanagement.controller;

import com.example.coursemanagement.MyUtils.CommonResult;
import com.example.coursemanagement.mapper.*;
import com.example.coursemanagement.pojo.Course;
import com.example.coursemanagement.pojo.Teacher;
import com.example.coursemanagement.pojo.User;
import com.example.coursemanagement.pojo.Class;

import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/home" )
@RequiredArgsConstructor
public class HomePageController {
    private final CourseMapper courseMapper;
    private final TeacherMapper teacherMapper;
    private final UserMapper userMapper;
    private final ClassMapper classMapper;

    @ApiOperation("班级的人数")
    @GetMapping("/classnums")
    public CommonResult<Object> getCoursAndPersonnum(){
        //所有的班级
        List<Class> classes = classMapper.selectList(null);
        return CommonResult.success(classes);
    }



}
